/*
 *  Class name: ContactTypeHandler.java
 *  Version: 1.0
 *  Date: 4.6.2014
 */
package cz.muni.fi.pv168.addressbook.gui.utils;

import cz.muni.fi.pv168.addressbook.entities.ContactType;
import javax.swing.ImageIcon;

/**
 *
 * @author Michal Ďuriš
 */
public class ContactTypeHandler {

    private static final ImageIcon HOME_ICON = new ImageIcon(
            ContactTypeHandler.class.getResource(
                    "/cz/muni/fi/pv168/addressbook/resources/icons/buttons/Home_icon.png"));

    private static final ImageIcon EMAIL_ICON = new ImageIcon(
            ContactTypeHandler.class.getResource(
                    "/cz/muni/fi/pv168/addressbook/resources/icons/buttons/Mail-icon.png"));

    private static final ImageIcon PHONE_ICON = new ImageIcon(
            ContactTypeHandler.class.getResource(
                    "/cz/muni/fi/pv168/addressbook/resources/icons/buttons/Mobile_phone_icon.png"));

    private ContactTypeHandler() {
    }

    public static ImageIcon getContactTypImageIcon(ContactType contactType)
            throws IllegalStateException {

        switch (contactType) {
            case ADDRESS:
                return HOME_ICON;
            case EMAIL:
                return EMAIL_ICON;
            case PHONE:
                return PHONE_ICON;
            default:
                throw new IllegalStateException(
                        "UNRECOGNIZED CONTACT TYPE IN GET CONTACT ICON METHOD !!!");
        }
    }

    public static String getContactTypeInternationalizedTitle(
            ContactType contactType) throws IllegalStateException {

        switch (contactType) {
            case ADDRESS:
                return "InputMessage.Title.address";
            case EMAIL:
                return "InputMessage.Title.email";
            case PHONE:
                return "InputMessage.Title.phone";
            default:
                throw new IllegalStateException(
                        "UNRECOGNIZED CONTACT TYPE IN GET CONTACT TITLE METHOD !!!");
        }
    }

    public static String getContactTypeInternationalizedText(
            ContactType contactType) throws IllegalStateException {

        switch (contactType) {
            case ADDRESS:
                return "InputMessage.Text.address";
            case EMAIL:
                return "InputMessage.Text.email";
            case PHONE:
                return "InputMessage.Text.phone";
            default:
                throw new IllegalStateException(
                        "UNRECOGNIZED CONTACT TYPE IN GET CONTACT TEXT METHOD !!!");
        }
    }

    public static String getContactTypeInternationalizedTooltipText(
            ContactType contactType) {

        switch (contactType) {
            case ADDRESS:
                return "DetailDialogWindow.homeButton.toolTipText";
            case EMAIL:
                return "DetailDialogWindow.emailButton.toolTipText";
            case PHONE:
                return "DetailDialogWindow.phoneButton.toolTipText";
            default:
                throw new IllegalStateException(
                        "UNRECOGNIZED CONTACT TYPE IN SET CONTACT TOOL TIP TEXT !!!");
        }
    }
}
